package com.xs.project.enums;

public enum ResourceType {
    RESOURCE_TYPE_VIDEO(1,"视频"),
    RESOURCE_TYPE_DOC(2,"文档"),
    RESOURCE_TYPE_PDF(3,"PDF"),
    RESOURCE_TYPE_WORD(4,"WORD"),
    RESOURCE_TYPE_OTHER(5,"其他");
    Integer type;
    String desc;

    ResourceType(int i, String desc) {
        this.type = i;
        this.desc = desc;
    }

    public static String getDesc(Integer type) {
        for (ResourceType value : ResourceType.values()) {
            if (value.type.equals(type)) {
                return value.desc;
            }
        }
        return RESOURCE_TYPE_OTHER.desc;
    }
}
